<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one
  ~ or more contributor license agreements.  See the NOTICE file
  ~ distributed with this work for additional information
  ~ regarding copyright ownership.  The ASF licenses this file
  ~ to you under the Apache License, Version 2.0 (the
  ~ "License"); you may not use this file except in compliance
  ~ with the License.  You may obtain a copy of the License at
  ~
  ~   http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing,
  ~ software distributed under the License is distributed on an
  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  ~ KIND, either express or implied.  See the License for the
  ~ specific language governing permissions and limitations
  ~ under the License.
-->

<div style="background-color: snow; padding: 20px; border-radius: 6px; box-shadow: 7px 5px #b421cc">
  <form nz-form [formGroup]="form" (ngSubmit)="submit()" role="form">
    <nz-tabset [nzAnimated]="false" class="tabs" (nzSelectChange)="switch($event)">
      <nz-tab [nzTitle]="'app.login.tab-login-credentials' | i18n">
        <nz-alert *ngIf="error" [nzType]="'error'" [nzMessage]="error" [nzShowIcon]="true" class="mb-lg"></nz-alert>
        <nz-form-item>
          <nz-form-control [nzErrorTip]="'app.login.message-need-identifier' | i18n">
            <nz-input-group nzSize="large" nzPrefixIcon="user">
              <input nz-input formControlName="userName" [placeholder]="'app.login.message-need-identifier' | i18n" />
            </nz-input-group>
          </nz-form-control>
        </nz-form-item>
        <nz-form-item>
          <nz-form-control [nzErrorTip]="'app.login.message-need-credential' | i18n">
            <nz-input-group nzSize="large" nzPrefixIcon="lock">
              <input nz-input type="password" formControlName="password" [placeholder]="'app.login.message-need-credential' | i18n" />
            </nz-input-group>
          </nz-form-control>
        </nz-form-item>
        <nz-form-item>
          <nz-col [nzSpan]="12">
            <label nz-checkbox formControlName="remember">{{ 'app.login.remember-me' | i18n }}</label>
          </nz-col>
        </nz-form-item>
        <nz-form-item>
          <button nz-button type="submit" nzType="primary" nzSize="large" [nzLoading]="loading" nzBlock>
            {{ 'app.login.login' | i18n }}
          </button>
        </nz-form-item>
      </nz-tab>
      <nz-tab [nzTitle]="'app.login.explore.cloud' | i18n">
        <div style="margin-top: 20%; margin-bottom: 20%; text-align: center">
          <a href="https://console.tancloud.cn/" target="_blank">
            <div class="hoverClass" style="border-radius: 4px; background-color: #3f51b5; padding: 6px; color: white">
              {{ 'app.login.explore.cloud.detail' | i18n }}
              <span nz-icon nzType="global" nzTheme="outline"></span>
            </div>
          </a>
        </div>
      </nz-tab>
    </nz-tabset>
  </form>
</div>
